#include "stdafx.h"
#include "../include/GcConstVariable.h"
#include "math.h"

using namespace GeoCalculator;

const double GcConstVariable::pi = 3.1415926;
const double GcConstVariable::a = 6378.137;
const double GcConstVariable::b = 6356.7523142;
const double GcConstVariable::e2 = 0.00669437999013;
const double GcConstVariable::radius = 6378.137;
const double GcConstVariable::f = 1 / 298.2572236;

GcConstVariable::GcConstVariable()
{
}

GcConstVariable::~GcConstVariable()
{
}

inline double GcConstVariable::deg2rad(double deg)
{
	return deg / 180.0 * pi;
}

inline double GcConstVariable::rad2deg(double rad)
{
	return rad * 180.0 / pi;
}

inline double GcConstVariable::n(double lat, bool rad)
{
	if (!rad)
		lat = deg2rad(lat);

	return a / sqrt(1 - e2*sin(lat)*sin(lat));
}
